package com.tianhua.javs.core.func.translate.varassign;

import com.tianhua.javs.client.bean.JavsSegmentBean;
import com.tianhua.javs.client.func.ITranslatorFunc;
import com.tianhua.javs.core.annotations.Segment;
import com.tianhua.javs.core.func.translate.AbstractTranslator;
import org.springframework.stereotype.Component;

/**
 * Description:
 * date: 2022/2/12
 *
 * @author shenshuai
 * @version 1.0.0
 * @since JDK 1.8
 */
@Component(value = "set")
@Segment(tag = "set(",scriptFuncBean = "assignFunc")
public class Set extends AbstractTranslator implements ITranslatorFunc {
    @Override
    public JavsSegmentBean translate(String shellSegment) {
       /* if(shellSegment.startsWith("map(")){
            shellSegment = shellSegment.replaceFirst("map\\(","Maps.newHashMap(");
        }
        Segment segment = Ifnull.class.getAnnotation(Segment.class);
        return JavsSegmentBean.getInstance(shellSegment,segment.keySuffix(),segment.valueSuffix());
*/
        return  translateStartReplaceFirst(shellSegment, Set.class,"Sets.newHashSet(");

    }
}
